import request from '@/utils/request'

// 获取树
export function getTreeList(query) {
  return request({
    url: '/archive/collection/data/tree/list',
    method: 'get',
    params: query
  })
}

// 新增资料树节点
export function addTree(data) {
  return request({
    url: '/archive/collection/data/tree',
    method: 'post',
    data: data
  })
}

// 获取资料树节点详细信息
export function getTreeDetail(id) {
  return request({
    url: '/archive/collection/data/tree/'+ id,
    method: 'get'
  })
}

// 修改资料树节点
export function updateTree(data) {
  return request({
    url: '/archive/collection/data/tree',
    method: 'put',
    data: data
  })
}

// 删除资料树节点
export function detailTree(id) {
  return request({
    url: '/archive/collection/data/tree/'+ id,
    method: 'delete'
  })
}

// 获取类别列表
export function getTableList(query) {
  return request({
    url: '/archive/collection/data/category/list',
    method: 'get',
    params: query
  })
}

// 新增资料树类别
export function addCode(data) {
  return request({
    url: '/archive/collection/data/category',
    method: 'post',
    data: data
  })
}

// 获取资料树节点详细信息
export function getCodeDetail(id) {
  return request({
    url: '/archive/collection/data/category/'+ id,
    method: 'get'
  })
}

// 修改资料树类别
export function updateCode(data) {
  return request({
    url: '/archive/collection/data/category',
    method: 'put',
    data: data
  })
}

// 删除资料树节点
export function detailCode(id) {
  return request({
    url: '/archive/collection/data/category/'+ id,
    method: 'delete'
  })
}
